<?php

namespace App\Filament\User\Pages;

use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Pages\Page;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Form;
use Filament\Forms\Components\TextInput;
use Filament\Support\Enums\MaxWidth;
use Illuminate\Contracts\Support\Htmlable;
use Spatie\MediaLibrary\InteractsWithMedia;
use Filament\Forms\Components\Tabs;
use Filament\Forms\Components\Tabs\Tab;
use Filament\Forms\Components\FileUpload;

class Profile extends Page implements HasForms
{
    use InteractsWithForms;

    protected static ?string $navigationIcon = 'heroicon-o-document-text';

    protected static string $view = 'filament.user.pages.profile';

    protected static bool $shouldRegisterNavigation = false;


    public function form(Form $form):Form
    {
        return $form
            ->schema([
                Tabs::make('Tabs')
                   ->tabs([
                       Tab::make('update profile')->label('基本资料')
                          ->schema([
                              FileUpload::make('avatar_url')->label('头像')->avatar(),
                              TextInput::make('name')->label('name')
                          ]),
                       Tab::make('update great')->label('修改密码')
                           ->schema([
                               TextInput::make('name')->label('name2')
                           ]),
                       Tab::make('update profile1')->label('第三方登录绑定')
                           ->schema([
                               TextInput::make('name')->label('name3')
                           ]),
                       Tab::make('update profile2')->label('提现设置')
                           ->schema([
                               TextInput::make('name')->label('name3')
                           ])
                   ])

            ]);
    }

    public function getTitle(): string|Htmlable
    {
        return "";
    }

    public function getMaxContentWidth(): MaxWidth|string|null
    {
        return MaxWidth::TwoExtraLarge;
    }
}
